// SpringTail : Simple Logging Abstraction block
// Copyright (c) 2008 Michael Saunders <mike@mikesaunders.com>
// All rights reserved.
// Released under Apache License 2.0 <www.apache.org/licenses>
// 
using System;

namespace SpringTail
{
	public class LogMessage
	{
		private readonly Exception _exception;
		private readonly LogLevel _level;
		private readonly string _loggerName;
		private readonly object _loggerOwner;
		private readonly string _message;
		private readonly object _data;

		public LogMessage(LogLevel level, string loggerName, object loggerOwner, string message, object tag)
		{
			_level = level;
			_loggerName = loggerName;
			_loggerOwner = loggerOwner;
			_message = message;
			_data = tag;
		}

		public LogMessage(LogLevel level, string loggerName, object loggerOwner, string message, object tag, Exception exception) : this(level, loggerName, loggerOwner, message, tag)
		{
			if (exception == null)
				throw new ArgumentNullException("exception");

			_exception = exception;
		}

		public LogLevel Level
		{
			get { return _level; }
		}

		public string LoggerName
		{
			get { return _loggerName; }
		}

		public object LoggerOwner
		{
			get { return _loggerOwner; }
		}

		public string Message
		{
			get { return _message; }
		}

		public Exception Exception
		{
			get { return _exception; }
		}

		public object Data
		{
			get { return _data; }
		}
	}
}